package models

import (
	"github.com/gookit/validate"
	"gorm.io/gorm"
	"time"
)

type Demo struct {
	ID        int            `json:"id" gorm:"primarykey" form:"id" validate:"required|int"`
	CreatedAt time.Time      `json:"created_at"`
	UpdatedAt time.Time      `json:"updated_at"`
	DeletedAt gorm.DeletedAt `json:"deleted_at"`
	Title     string         `json:"title" form:"title" validate:"required"` // 任务id
}

// GetScene 定义验证场景
func (d *Demo) GetScene() validate.SValues {
	return validate.SValues{
		"add":    []string{"Title"},
		"update": []string{"ID", "Title"},
		"del":    []string{"ID"},
		"get":    []string{"ID"},
	}
}
